﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._16_责任链模式
{
    /// <summary>
    /// CEO审批人
    /// </summary>
    public class CEOApprover:Approver
    {
        /// <summary>
        /// 处理请求
        /// </summary>
        /// <param name="request"></param>
        public override void ProcessRequest(PurchaseRequest request)
        {
            if (request.Amount <= 100000)
            {
                Console.WriteLine($"CEO批准了{request.Amount}元的{request.Purpose}采购");
            }
            else
            {
                Console.WriteLine($"金额过大({request.Amount}元)，需要董事会审批");
            }
        }


    }
}
